/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package hotel.jpa;

import entities.Booking;
import entities.GuestUser;
import entities.Room;
import javax.persistence.EntityManagerFactory;
import javax.persistence.Persistence;

/**
 *
 * @author Anton Karlsson
 */
public final class Database {
    
  private static final EntityManagerFactory emf = Persistence.createEntityManagerFactory("hotel_pu");
  private static final IRoomJpaCtrl roomCtrl = new RoomJpaCtrl(null, emf); 
  private static final IJpaCtrl userCtrl = new UserJpaCtrl(null, emf); 
  private static final IBookingJpaCtrl bookingCtrl = new BookingJpaCtrl(null, emf); 
            
    private Database() {
    }
    
    public static IRoomJpaCtrl<Room> getRoomController() {
        return roomCtrl; 
    }
    
    public static IJpaCtrl<GuestUser> getUserController() {
        return userCtrl; 
    }
    
    public static IBookingJpaCtrl<Booking> getBookingController() {
        return bookingCtrl; 
    }
}
